package com.cq.hd.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cq.hd.order.api.dto.OrderSettleBillDto;
import com.cq.hd.order.api.dto.OrderSettleBillUpdateStateDto;
import com.cq.hd.order.api.vo.MerchantOrderAmtStatVo;
import com.cq.hd.order.api.vo.OrderSettleBillVo;
import com.cq.hd.order.po.TbOrderSettleBillPo;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 订单结算支付流水记录表 服务类
 * </p>
 *
 * @author mYunYu
 * @since 2024-01-23
 */
public interface TbOrderSettleBillService extends IService<TbOrderSettleBillPo> {

    List<OrderSettleBillVo> listByDto(OrderSettleBillDto orderSettleBillDto);

    Boolean transactAmt(OrderSettleBillVo orderSettleBillVo);

    OrderSettleBillVo getOrderSettleBillById(Long id);

    /**
     * 对订单结算支付流水记录表进行转账
     * 目录仅用在【商户补贴转账】
     */
    Boolean transferByOrderSettleBill(OrderSettleBillVo orderSettleBillVo);

    /**
     * 对订单结算单进行月度结算
     *
     * @param monthSettleBillId 月度结算单id
     * @param orderSettleIds 订单结算单id
     * @return 影响条数
     */
    int monthSettleOrderSettleBills(Long monthSettleBillId, List<Long> orderSettleIds);

    /**
     * 获取商户待入账本金 & 补贴（已结算，未计入月度账单的补贴金额）
     *
     * @param merchantId 商户id
     * @return 商户待入账补贴
     */
    MerchantOrderAmtStatVo getMerchantPendingAmt(Long merchantId);

    // 商家待支付补贴金额
    BigDecimal getBusinessWaitPaySubsidyAmt(Long merchantId);

    Integer updateTradeState(OrderSettleBillUpdateStateDto orderSettleBillUpdateStateDto);

    void scanRecoverAmtTransfer();

}
